<?php   
 /* CAT:Line chart */

 /* pChart library inclusions */
 include(classes_path()."pChart/class/pData.class.php");
 include(classes_path()."pChart/class/pDraw.class.php");
 include(classes_path()."pChart/class/pImage.class.php");

    $myData = new pData();
    $myData->addPoints(array(1,3,4),"Serie1");
    $myData->setSerieDescription("Serie1","Serie 1");
    $myData->setSerieOnAxis("Serie1",0);

    $myData->addPoints(array("January","February","March","April","May","June","July","August"),"Absissa");
    $myData->setAbscissa("Absissa");

    $myData->setAxisPosition(0,AXIS_POSITION_LEFT);
    $myData->setAxisName(0,"Number Applicant");
    $myData->setAxisUnit(0,"");

    $myPicture = new pImage(700,230,$myData);
    $Settings = array("R"=>251, "G"=>98, "B"=>128, "Dash"=>1, "DashR"=>271, "DashG"=>118, "DashB"=>148);
    $myPicture->drawFilledRectangle(0,0,700,230,$Settings);

    $Settings = array("StartR"=>251, "StartG"=>98, "StartB"=>128, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50);
    $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings);

    $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0));

    $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>50,"G"=>50,"B"=>50,"Alpha"=>20));

    $myPicture->setFontProperties(array("FontName"=>classes_path()."pChart/fonts/Forgotte.ttf","FontSize"=>14));
    $TextSettings = array("Align"=>TEXT_ALIGN_MIDDLEMIDDLE
    , "R"=>255, "G"=>255, "B"=>255, "DrawBox"=>1, "BoxAlpha"=>30);
    $myPicture->drawText(350,25,"Applies Line Chart Report",$TextSettings);

    $myPicture->setShadow(FALSE);
    $myPicture->setGraphArea(50,50,675,190);
    $myPicture->setFontProperties(array("R"=>255,"G"=>255,"B"=>255,"FontName"=>classes_path()."pChart/fonts/Forgotte.ttf","FontSize"=>6));

    $Settings = array("Pos"=>SCALE_POS_LEFTRIGHT
    , "Mode"=>SCALE_MODE_FLOATING
    , "LabelingMethod"=>LABELING_ALL
    , "GridR"=>255, "GridG"=>255, "GridB"=>255, "GridAlpha"=>50, "TickR"=>0, "TickG"=>0, "TickB"=>0, "TickAlpha"=>50, "LabelRotation"=>0, "DrawArrows"=>1, "DrawXLines"=>1, "DrawSubTicks"=>1, "SubTickR"=>255, "SubTickG"=>0, "SubTickB"=>0, "SubTickAlpha"=>50, "DrawYLines"=>ALL);
    $myPicture->drawScale($Settings);

    $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>50,"G"=>50,"B"=>50,"Alpha"=>10));

    $Config = "";
    $myPicture->drawSplineChart($Config);

    $Config = array("FontR"=>0, "FontG"=>0, "FontB"=>0, "FontName"=>classes_path()."pChart/fonts/Forgotte.ttf", "FontSize"=>6, "Margin"=>6, "Alpha"=>30, "BoxSize"=>5, "Style"=>LEGEND_NOBORDER
    , "Mode"=>LEGEND_HORIZONTAL
    );
    $myPicture->drawLegend(647,16,$Config);
    
    $myPicture->stroke();
?>
